using UnityEngine;
using System.Collections;

public class highScore : MonoBehaviour {
	
	public int scoreOne = 0;
	public int scoreTwo = 0;
	public int scoreThree = 0;
	public int scoreFour = 0;
	public int scoreFive = 0;
	public int scoreSix = 0;
	public int scoreSeven = 0;
	public int scoreEight = 0;
	public int scoreNine = 0;
	public int scoreTen = 0;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void onGUI() {
		GUILayout.BeginArea(new Rect(10, 15, 50, 20));
		GUILayout.Box("1st");
		GUILayout.EndArea();
		GUILayout.BeginArea(new Rect(65,15,100,200 ));
		GUILayout.Box (scoreOne.ToString () );
    	GUILayout.EndArea ();
		GUILayout.BeginArea(new Rect(10, 25, 50, 20));
		GUILayout.Box("2nd");
		GUILayout.EndArea();
		GUILayout.BeginArea(new Rect(65,25,100,200 ));
		GUILayout.Box (scoreTwo.ToString () );
    	GUILayout.EndArea ();
		GUILayout.BeginArea(new Rect(10, 35, 50, 20));
		GUILayout.Box("3rd");
		GUILayout.EndArea();
		GUILayout.BeginArea(new Rect(65,35,100,200 ));
		GUILayout.Box (scoreThree.ToString () );
    	GUILayout.EndArea ();
		GUILayout.BeginArea(new Rect(10, 45, 50, 20));
		GUILayout.Box("4th");
		GUILayout.EndArea();
		GUILayout.BeginArea(new Rect(65,45,100,200 ));
		GUILayout.Box (scoreFour.ToString () );
    	GUILayout.EndArea ();
		GUILayout.BeginArea(new Rect(10, 55, 50, 20));
		GUILayout.Box("5th");
		GUILayout.EndArea();
		GUILayout.BeginArea(new Rect(65,55,100,200 ));
		GUILayout.Box (scoreFive.ToString () );
    	GUILayout.EndArea ();
		GUILayout.BeginArea(new Rect(10, 65, 50, 20));
		GUILayout.Box("6th");
		GUILayout.EndArea();
		GUILayout.BeginArea(new Rect(65,65,100,200 ));
		GUILayout.Box (scoreSix.ToString () );
    	GUILayout.EndArea ();
		GUILayout.BeginArea(new Rect(10, 75, 50, 20));
		GUILayout.Box("7th");
		GUILayout.EndArea();
		GUILayout.BeginArea(new Rect(65,75,100,200 ));
		GUILayout.Box (scoreSeven.ToString () );
    	GUILayout.EndArea ();
		GUILayout.BeginArea(new Rect(10, 85, 50, 20));
		GUILayout.Box("8th");
		GUILayout.EndArea();
		GUILayout.BeginArea(new Rect(65,85,100,200 ));
		GUILayout.Box (scoreEight.ToString () );
    	GUILayout.EndArea ();
		GUILayout.BeginArea(new Rect(10, 95, 50, 20));
		GUILayout.Box("9th");
		GUILayout.EndArea();
		GUILayout.BeginArea(new Rect(65,95,100,200 ));
		GUILayout.Box (scoreNine.ToString () );
    	GUILayout.EndArea ();
		GUILayout.BeginArea(new Rect(10, 105, 50, 20));
		GUILayout.Box("10th");
		GUILayout.EndArea();
		GUILayout.BeginArea(new Rect(65,105,100,200 ));
		GUILayout.Box (scoreTen.ToString () );
    	GUILayout.EndArea ();
		if(GUI.Button(new Rect(15, 135, 200, 200), "Back to Main Menu")) {
			Application.LoadLevel("Test2");	
		}
	}
	
	void scoreCheck() {
		if(scoreOne > guiScore.currentScore) {
			scoreTen = scoreNine;
			scoreNine = scoreEight;
			scoreEight = scoreSeven;
			scoreSeven = scoreSix;
			scoreSix = scoreFive;
			scoreFive = scoreFour;
			scoreFour = scoreThree;
			scoreThree = scoreTwo;
			scoreTwo = scoreOne;
			scoreOne = guiScore.currentScore;
		}
		
		else if(scoreTwo > guiScore.currentScore) {
			scoreTen = scoreNine;
			scoreNine = scoreEight;
			scoreEight = scoreSeven;
			scoreSeven = scoreSix;
			scoreSix = scoreFive;
			scoreFive = scoreFour;
			scoreFour = scoreThree;
			scoreThree = scoreTwo;
			scoreTwo = guiScore.currentScore;
		}
		
		else if(scoreThree > guiScore.currentScore) {
			scoreTen = scoreNine;
			scoreNine = scoreEight;
			scoreEight = scoreSeven;
			scoreSeven = scoreSix;
			scoreSix = scoreFive;
			scoreFive = scoreFour;
			scoreFour = scoreThree;
			scoreThree = guiScore.currentScore;
		}
		
		else if(scoreFour > guiScore.currentScore) {
			scoreTen = scoreNine;
			scoreNine = scoreEight;
			scoreEight = scoreSeven;
			scoreSeven = scoreSix;
			scoreSix = scoreFive;
			scoreFive = scoreFour;
			scoreFour = guiScore.currentScore;
		}
		
		else if(scoreFive > guiScore.currentScore) {
			scoreTen = scoreNine;
			scoreNine = scoreEight;
			scoreEight = scoreSeven;
			scoreSeven = scoreSix;
			scoreSix = scoreFive;
			scoreFive = guiScore.currentScore;
		}
		
		else if(scoreSix > guiScore.currentScore) {
			scoreTen = scoreNine;
			scoreNine = scoreEight;
			scoreEight = scoreSeven;
			scoreSeven = scoreSix;
			scoreSix = guiScore.currentScore;
		}
		
		else if(scoreSeven > guiScore.currentScore) {
			scoreTen = scoreNine;
			scoreNine = scoreEight;
			scoreEight = scoreSeven;
			scoreSeven = guiScore.currentScore;
		}
		
		else if(scoreEight > guiScore.currentScore) {
			scoreTen = scoreNine;
			scoreNine = scoreEight;
			scoreEight = guiScore.currentScore;
		}
		
		else if(scoreNine > guiScore.currentScore) {
			scoreTen = scoreNine;
			scoreNine = guiScore.currentScore;
		}
		
		else if(scoreTen > guiScore.currentScore) {
			scoreTen = guiScore.currentScore;
		}
	}
}
